﻿@using ViewRes
@model DonutMgmtSystemFoundation.Models.GeneralJsonResultModel

@{
    Layout = "~/Views/Shared/_LoginLayout.cshtml";
}

@section Pagename{
    @LoginStrings.DmsfLogin
}

@section Script{
    <script type="text/javascript">
        $(function () {
            $('.ui.form').form({
                username: {
                    identifier: 'Username',
                    rules: [
                      {
                          type: 'empty',
                          prompt: '@LoginStrings.WriteUsername'
                      }
                    ]
                },
                password: {
                    identifier: 'Password',
                    rules: [
                      {
                          type: 'empty',
                          prompt: '@LoginStrings.WritePassword'
                      }
                    ]
                }
            });

            $(".changelang").click(function () {
                var lang = $(this).attr('data-lang');

                window.location = ("@Url.Action("ChangeLanguage", "Language")?language=" + lang);                
            });
        });
    </script>
}

<div class="ui three column grid">
    <div class="computer only row row">
        <div class="column"></div>
        <div class="column">
            <div class="ui fluid segment">
                <form action="/Login/Login" method="post" class="ui form">
                    <h3 class="ui header">@LoginStrings.Login</h3>
                    <div class="field">
                        <label>@LoginStrings.User</label>
                        <div class="ui left icon input">
                            <input placeholder="@LoginStrings.Username" type="text" name="Username">
                            <i class="user icon"></i>
                        </div>
                    </div>
                    <div class="field">
                        <label>@LoginStrings.Password</label>
                        <div class="ui left icon input">
                            <input placeholder="@LoginStrings.Password" type="password" name="Password">
                            <i class="unlock icon"></i>
                        </div>
                    </div>
                    <input type="submit" value="@LoginStrings.Login" class="ui blue submit button">
                    <div class="ui error message"></div>
                </form>

                <div class="ui clearing divider"></div>

                @Html.ActionLink(LoginStrings.ForgotPassword, "ForgetPassword", "Login") @Shared.or
                @Html.ActionLink(LoginStrings.Register, "Register", "Login")
                @if (!@Model.Success)
                {
                    <div class="ui red message">@Model.Message</div>
                }

                <div class="ui clearing divider"></div>


                <div class="ui button changelang" data-lang="en">@Shared.LangEnglish</div>
                <div class="ui button changelang" data-lang="es-mx">@Shared.LangSpanish</div>

            </div>
        </div>
        <div class="column"></div>
    </div>
    <div class="mobile tablet only row">
        <div class="column">
            <div class="ui fluid segment">
                <form action="/Login/Login" method="post" class="ui form">
                    <h3 class="ui header">@LoginStrings.Login</h3>
                    <div class="field">
                        <label>@LoginStrings.User</label>
                        <div class="ui left icon input">
                            <input placeholder="@LoginStrings.Username" type="text" name="Username">
                            <i class="user icon"></i>
                        </div>
                    </div>
                    <div class="field">
                        <label>@LoginStrings.Password</label>
                        <div class="ui left icon input">
                            <input placeholder="@LoginStrings.Password" type="password" name="Password">
                            <i class="unlock icon"></i>
                        </div>
                    </div>
                    <input type="submit" value="@LoginStrings.Login" class="ui blue submit button">
                    <div class="ui error message"></div>
                </form>

                <div class="ui clearing divider"></div>

                @Html.ActionLink(LoginStrings.ForgotPassword, "ForgetPassword", "Login") @Shared.or
                @Html.ActionLink(LoginStrings.Register, "Register", "Login")
                @if (!@Model.Success)
                {
                    <div class="ui red message">@Model.Message</div>
                }

                <div class="ui clearing divider"></div>


                <div class="ui button" data-lang="en">@Shared.LangEnglish</div>
                <div class="ui button" data-lang="es-mx">@Shared.LangSpanish</div>

            </div>
        </div>
        <div class="column"></div>
        <div class="column"></div>
    </div>
</div>

